function calcMostOpenableBtc(usdTradingAssert, lever, indexPrice) {
  if (isNaN(indexPrice) || isNaN(lever) || indexPrice <= 0) {
    return null;
  }
  return (usdTradingAssert * lever) / indexPrice;
}

function keepTwoDecimal(num) {
  return Math.floor((num * 100).toFixed(1)) / 100;
}

function calcUsdBond({ indexPrice, btcCount, lever }) {
  return (indexPrice * btcCount) / lever;
}

export { keepTwoDecimal };

export { calcMostOpenableBtc, calcUsdBond };
